public class Logic_Control {
    public static void main1(String[] args) {
        //判断一个数是奇数还是偶数
        int a = 10;
        if (a % 2 == 0) {
            System.out.println("偶数");
        } else {
            System.out.println("奇数");
        }
        System.out.println(" ");
    }
        //判断一个数是正数，负数，还是零
    public static void main2(String[] args) {
        int b = -10;
        if (b > 0) {
            System.out.println("正数");
        }
        else if (b < 0) {
            System.out.println("负数");
        }
        else {
            System.out.println("零");
        }
        System.out.println(" ");
    }
    //判断一个年份是世纪闰年还是普通闰年 ，或者不是闰年
    public static void main3(String[] args) {
        int year = 2000;
        if (year % 400 == 0) {
            System.out.println("世纪闰年");
        }
        else if (year % 4 == 0 && year % 100 != 0) {
            System.out.println("普通闰年");
        }
        else {
            System.out.println("不是闰年");
        }
        System.out.println(" ");
    }
    //用switch语句输出星期
    public static void main4(String[] args) {
        int day = 1;
        switch (day) {
            case 1:
                System.out.println("星期一");
                break;
            case 2:
                System.out.println("星期二");
                break;
            case 3:
                System.out.println("星期三");
                break;
            case 4:
                System.out.println("星期四");
                break;
            case 5:
                System.out.println("星期五");
        }
    }
    //用while循环嵌套求1到10的阶乘之和
    public static void main5(String[] args) {
        int num = 1;
        int sum = 0;
        while (num <= 10) {
            int i = 1;
            int j = 1;
            while (i <= num) {
                j = j * i;
                i++;
            }
            sum = sum + j;
            num++;
        }
        System.out.println(sum);
        System.out.println(" ");
    }



}